home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 2001 May / SGI IRIX Base Documentation 2001 May.iso / usr / share / catman / p_man / cat3s / tmpnam.z / tmpnam
Encoding:
Text File  |  2001-04-17  |  7.9 KB  |  133 lines

  1.  
  2.  
  3.  
  4. ttttmmmmppppnnnnaaaammmm((((3333SSSS))))                                                          ttttmmmmppppnnnnaaaammmm((((3333SSSS))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      _tttt_mmmm_pppp_nnnn_aaaa_mmmm, _tttt_eeee_mmmm_pppp_nnnn_aaaa_mmmm - create a name for a temporary file
  10.  
  11. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  12.      _####_iiii_nnnn_cccc_llll_uuuu_dddd_eeee _<<<<_ssss_tttt_dddd_iiii_oooo_...._hhhh_>>>>
  13.  
  14.      _cccc_hhhh_aaaa_rrrr _****_tttt_mmmm_pppp_nnnn_aaaa_mmmm _((((_cccc_hhhh_aaaa_rrrr _****_ssss_))))_;;;;
  15.  
  16.      _cccc_hhhh_aaaa_rrrr _****_tttt_eeee_mmmm_pppp_nnnn_aaaa_mmmm _((((_cccc_oooo_nnnn_ssss_tttt _cccc_hhhh_aaaa_rrrr _****_dddd_iiii_rrrr_,,,, _cccc_oooo_nnnn_ssss_tttt _cccc_hhhh_aaaa_rrrr _****_pppp_ffff_xxxx_))))_;;;;
  17.  
  18. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  19.      These functions generate file names that can safely be used for a
  20.      temporary file.
  21.  
  22.      _tttt_mmmm_pppp_nnnn_aaaa_mmmm always generates a file name using the path-prefix defined as
  23.      _PPPP______tttt_mmmm_pppp_dddd_iiii_rrrr in the _<<<<_ssss_tttt_dddd_iiii_oooo_...._hhhh_>>>> header file.  If _s is _NNNN_UUUU_LLLL_LLLL, _tttt_mmmm_pppp_nnnn_aaaa_mmmm leaves its
  24.      result in an internal static area and returns a pointer to that area.
  25.      The next call to _tttt_mmmm_pppp_nnnn_aaaa_mmmm will destroy the contents of the area.  If _s is
  26.      not _NNNN_UUUU_LLLL_LLLL, it is assumed to be the address of an array of at least
  27.      _LLLL______tttt_mmmm_pppp_nnnn_aaaa_mmmm bytes, where _LLLL______tttt_mmmm_pppp_nnnn_aaaa_mmmm is a constant defined in _<<<<_ssss_tttt_dddd_iiii_oooo_...._hhhh_>>>>; _tttt_mmmm_pppp_nnnn_aaaa_mmmm
  28.      places its result in that array and returns _s.
  29.  
  30.      _tttt_eeee_mmmm_pppp_nnnn_aaaa_mmmm allows the user to control the choice of a directory.  The
  31.      argument _d_i_r points to the name of the directory in which the file is to
  32.      be created.  If _d_i_r is _NNNN_UUUU_LLLL_LLLL or points to a string that is not a name for
  33.      an appropriate directory, the path-prefix defined as _PPPP______tttt_mmmm_pppp_dddd_iiii_rrrr in the
  34.      _<<<<_ssss_tttt_dddd_iiii_oooo_...._hhhh_>>>> header file is used.  If that directory is not accessible, _////_tttt_mmmm_pppp
  35.      will be used as a last resort.  To override this entire sequence, provide
  36.      a _TTTT_MMMM_PPPP_DDDD_IIII_RRRR environment variable in the user's environment; the variable's
  37.      value is the name of the desired temporary-file directory. If the
  38.      directory specified by the variable _TTTT_MMMM_PPPP_DDDD_IIII_RRRR is not accessible, the
  39.      sequence is then used to determine the temporary-file directory.
  40.  
  41.      Many applications prefer their temporary files to have certain favorite
  42.      initial letter sequences in their names.  Use the _p_f_x argument for this.
  43.      This argument may be _NNNN_UUUU_LLLL_LLLL or point to a string of up to five characters
  44.      to be used as the first few characters of the temporary-file name.
  45.  
  46.      _tttt_eeee_mmmm_pppp_nnnn_aaaa_mmmm uses _mmmm_aaaa_llll_llll_oooo_cccc to get space for the constructed file name, and
  47.      returns a pointer to this area.  Thus, any pointer value returned from
  48.      _tttt_eeee_mmmm_pppp_nnnn_aaaa_mmmm may serve as an argument to _ffff_rrrr_eeee_eeee [see _mmmm_aaaa_llll_llll_oooo_cccc(3C)].  If _tttt_eeee_mmmm_pppp_nnnn_aaaa_mmmm
  49.      cannot return the expected result for any reason-e.g., _mmmm_aaaa_llll_llll_oooo_cccc failed-or
  50.      none of the above mentioned attempts to find an appropriate directory was
  51.      successful, a _NNNN_UUUU_LLLL_LLLL pointer will be returned.
  52.  
  53.      _tttt_eeee_mmmm_pppp_nnnn_aaaa_mmmm fails if there is not enough space.
  54.  
  55. FFFFIIIILLLLEEEESSSS
  56.      _pppp______tttt_mmmm_pppp_dddd_iiii_rrrr
  57.             _////_vvvv_aaaa_rrrr_////_tttt_mmmm_pppp
  58.  
  59.  
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. ttttmmmmppppnnnnaaaammmm((((3333SSSS))))                                                          ttttmmmmppppnnnnaaaammmm((((3333SSSS))))
  71.  
  72.  
  73.  
  74. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  75.      _cccc_rrrr_eeee_aaaa_tttt(2), _uuuu_nnnn_llll_iiii_nnnn_kkkk(2), _ffff_oooo_pppp_eeee_nnnn(3S), _mmmm_aaaa_llll_llll_oooo_cccc(3C), _mmmm_kkkk_tttt_eeee_mmmm_pppp(3C), _tttt_mmmm_pppp_ffff_iiii_llll_eeee(3S).
  76.  
  77. WWWWAAAARRRRNNNNIIIINNNNGGGG
  78.      _tttt_mmmm_pppp_nnnn_aaaa_mmmm should not be called with _s equal to a NNNNUUUULLLLLLLL pointer in a
  79.      multithreaded application due to the use of an internal static buffer for
  80.      the return value.
  81.  
  82. NNNNOOOOTTTTEEEESSSS
  83.      These functions generate a different file name each time they are called.
  84.  
  85.      Files created using these functions and either _ffff_oooo_pppp_eeee_nnnn or _cccc_rrrr_eeee_aaaa_tttt are
  86.      temporary only in the sense that they reside in a directory intended for
  87.      temporary use, and their names are unique.  It is the user's
  88.      responsibility to remove the file when its use is ended.
  89.  
  90.      Each call to _t_m_p_n_a_m will make 26 attempts to create a filename which does
  91.      not duplicate an existing file.  If this fails, the first character of s
  92.      will be zeroed, and _t_m_p_n_a_m will return the empty string.
  93.  
  94.      A call to _t_e_m_p_n_a_m will also make 26 attempts to create a filename which
  95.      does not duplicate an existing file.  If this fails, _t_e_m_p_n_a_m will return
  96.      NULL.
  97.  
  98.      If called more than _TTTT_MMMM_PPPP______MMMM_AAAA_XXXX (defined in _ssss_tttt_dddd_iiii_oooo_...._hhhh) times in a single
  99.      process, these functions start recycling previously used names.
  100.  
  101.      Between the time a file name is created and the file is opened, it is
  102.      possible for some other process to create a file with the same name.
  103.      This can never happen if that other process is using these functions or
  104.      _mmmm_kkkk_tttt_eeee_mmmm_pppp and the file names are chosen to render duplication by other means
  105.      unlikely.
  106.  
  107.      Both _t_e_m_p_n_a_m and _t_m_p_n_a_m_e use _m_k_t_e_m_p(3C).  To avoid the possibility of
  108.      generating identical filenames via two mechanisms, you should not call
  109.      _m_k_t_e_m_p directly when using _t_e_m_p_n_a_m or _t_m_p_n_a_m_e unless you can avoid the
  110.      use of the filename templates used by these routines.
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.